//
//  HMComposeButton.swift
//  Weibo
//
//  Created by Apple on 2017/7/16.
//  Copyright © 2017年 KY. All rights reserved.
//

import UIKit
//  自定义撰写菜单按钮
class HMComposeButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        titleLabel?.textAlignment = .center
        //  原始大小居中显示
        imageView?.contentMode = .center
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        imageView?.y = 0
        imageView?.width = self.bounds.size.width
        imageView?.height = self.bounds.size.width
        titleLabel?.y = self.bounds.size.width
        titleLabel?.x = 0
        titleLabel?.width = self.bounds.size.width
        titleLabel?.height = self.bounds.size.height - self.bounds.size.width
    }

}
